home *** CD-ROM | disk | FTP | other *** search
- /* Copyright (c) 1987, 1988 Stanley T. Shebs, University of Utah. */
- /* This program may be used, copied, modified, and redistributed freely */
- /* for noncommercial purposes, so long as this notice remains intact. */
-
- #pragma comment(exestr, "@(#) misc.h 12.1 95/05/09 ")
-
- /* RCS $Header: misc.h,v 1.1 88/06/21 12:29:43 shebs Exp $ */
-
- /* Random definitions useful for nearly any C program. */
-
- #ifndef SCO_UNIX
- typedef unsigned char unchar;
- typedef unsigned short unshort;
- #endif
-
- #define bool int
- #define TRUE (1)
- #define FALSE (0)
-
- #define abs(x) (((x) < 0) ? (0 - (x)) : (x))
-
- #define min(x,y) (((x) < (y)) ? (x) : (y))
-
- #define max(x,y) (((x) > (y)) ? (x) : (y))
-
- #define between(lo,n,hi) ((lo) <= (n) && (n) <= (hi))
-
- #define flip_coin() (random(257) % 2)
-
- #define avg(a,b) (((a) + (b)) / 2)
-
- #define iswhite(c) ((c) == ' ' || (c) == '\n' || (c) == '\t')
-
- #define lowercase(c) (isupper(c) ? tolower(c) : (c))
-
- #define uppercase(c) (islower(c) ? toupper(c) : (c))
-
- /* Miscellaneous declarations. */
-
- extern bool Debug, Build, Freeze;
-
- extern char spbuf[], tmpbuf[], version[];
- extern char *plural_form(), *copy_string(), *read_line();
- #ifdef UNIX
- extern char *getenv();
- #endif /* UNIX */
-
-